// import { Select } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
//import { useOptions } from "@/hooks/useOptions"
import { useLocale } from "@/locales"

export type BackAdjustTypeSelectorField = {
	BackAdjustTypeSelector: string
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const proxyPatchAddAdjustType = [
	{
		code: 1,
		userType: 1,
		value: 1,
		description: "funds.proxy_member_funds_record.agent_deposit_backstage"
	},
	{
		code: 2,
		userType: 1,
		value: 2,
		description: "funds.proxy_member_funds_record.agent_withraw_backstage"
	},
	{
		code: 3,
		userType: 0,
		value: 1,
		description: "funds.proxy_member_funds_record.member_deposit_backstage"
	},
	{
		code: 4,
		userType: 0,
		value: 2,
		description: "funds.proxy_member_funds_record.member_withraw_backstage"
	}
]
export const BackAdjustTypeSelector: FC<any> = props => {
	const { rules, disable, labelProps, selectorProps } = props
	const { formatMessage } = useLocale()
	const data = Object.entries(proxyPatchAddAdjustType)
	const options = data.map(item => ({ value: item[1].code, label: formatMessage({ id: item[1].description }) }))

	return (
		<SFormItem
			name="adjustType"
			rules={rules}
			{...labelProps}
			label={formatMessage({ id: "funds.proxy_member_funds_record.adjust_type" })}
		>
			<StyleSelect
				placeholder={formatMessage({ id: "label.select_all" })}
				allowClear
				options={options}
				disable={disable}
				{...selectorProps}
			/>
		</SFormItem>
	)
}
